<?

    function currency_sign() {

        if (isset($_GET['currency']))
            return lang($_GET['currency']);
        else
            return lang('EUR');
    }

    function currency_convert($data) {

        if (isset($_GET['currency']) && $_GET['currency']!=="EUR"):

            $keys = array('lowest_price', 'selling_total', 'price','price_total');

            require_once './application/libraries/currency.php';
            $myCurrency = new currency(array('base' => 'EUR', 'foreign' => $_GET['currency']));
            $myCurrency->setKeys($keys);
            $data = $myCurrency->convert($data);
            $data['rate'] = $myCurrency->getRate();
            return $data;

        else:
            $data['rate'] = 1;
            return $data;
        endif;
    }

?>